.layout {
  min-height: 100vh;
}

.header {
  display: flex;
  align-items: center;
  padding: 0 24px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  position: relative;
  z-index: 10;
  height: 64px;

  @media screen and (max-width: 768px) {
    padding: 0 16px;
  }
}

.logo {
  font-size: 20px;
  font-weight: bold;
  color: #1890ff;
  margin-right: 48px;
  white-space: nowrap;

  @media screen and (max-width: 768px) {
    margin-right: 16px;
    font-size: 18px;
  }
}

.search {
  flex: 1;
  max-width: 480px;
  margin-right: 16px;

  :global {
    .ant-input-search .ant-input-group .ant-input-affix-wrapper:not(:last-child) {
      border-radius: 24px 0 0 24px;
    }

    .ant-input-search .ant-input-group .ant-input-search-button {
      border-radius: 0 24px 24px 0;
      height: 40px;
    }

    .ant-input-affix-wrapper {
      height: 40px;
    }
  }

  @media screen and (max-width: 576px) {
    max-width: none;
  }
}

.actions {
  display: flex;
  align-items: center;

  :global {
    .ant-btn {
      height: 40px;
      border-radius: 20px;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 0 20px;

      .anticon {
        font-size: 16px;
        margin-right: 8px;
      }
    }
  }

  @media screen and (max-width: 576px) {
    :global {
      .ant-btn {
        padding: 0;
        width: 40px;
        border-radius: 50%;

        .anticon {
          margin-right: 0;
        }

        span:not(.anticon) {
          display: none;
        }
      }
    }
  }
}

.sider {
  background: #fff;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.03);
  position: relative;
  z-index: 5;

  :global {
    .ant-layout-sider-children {
      overflow-y: auto;
      overflow-x: hidden;
      height: calc(100vh - 64px);
    }

    .ant-menu-inline {
      border-right: none;
    }

    .ant-menu-item {
      margin: 0;
      border-radius: 0;
    }

    .ant-menu-submenu-title {
      margin: 0;
      border-radius: 0;
    }
  }
}

.contentLayout {
  padding: 0;
  background: #f0f2f5;
}

.content {
  padding: 24px;
  min-height: calc(100vh - 64px);
  overflow: auto;

  @media screen and (max-width: 768px) {
    padding: 16px;
  }
}

.breadcrumb {
  margin-bottom: 16px;
  
  :global {
    .ant-breadcrumb-link {
      color: #666;
    }
  }
}

.mainCard {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  min-height: 600px;

  :global {
    .ant-card-body {
      padding: 24px;
    }

    .ant-tabs-nav {
      margin-bottom: 24px;
    }

    .ant-tabs-tab {
      padding: 12px 16px;
      font-size: 16px;
    }
  }

  @media screen and (max-width: 768px) {
    :global {
      .ant-card-body {
        padding: 16px;
      }

      .ant-tabs-tab {
        padding: 8px 12px;
        font-size: 14px;
      }
    }
  }
}

// 暗色主题适配
@media (prefers-color-scheme: dark) {
  .header {
    background: #1f1f1f;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  }

  .logo {
    color: #177ddc;
  }

  .search {
    :global {
      .ant-input-search .ant-input-group .ant-input-affix-wrapper {
        background: #141414;
        border-color: #434343;
      }

      .ant-input-search .ant-input-group .ant-input-search-button {
        background: #177ddc;
        border-color: #177ddc;
      }

      .ant-input {
        background: #141414;
        color: #fff;
      }
    }
  }

  .sider {
    background: #1f1f1f;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);

    :global {
      .ant-menu.ant-menu-dark, 
      .ant-menu-dark .ant-menu-sub, 
      .ant-menu.ant-menu-dark .ant-menu-sub {
        background: #1f1f1f;
      }
    }
  }

  .contentLayout {
    background: #141414;
  }

  .breadcrumb {
    :global {
      .ant-breadcrumb-link {
        color: #999;
      }
    }
  }

  .mainCard {
    background: #1f1f1f;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  }
}

// 响应式调整
@media screen and (max-width: 992px) {
  .sider {
    position: absolute;
    height: calc(100vh - 64px);
    left: 0;
    z-index: 100;
  }
}